﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AutoCode.Win
{
    public class Config
    {
        public static string Dir
        {
            get { return Properties.Settings.Default.Dir.TrimEnd('\\'); }
            set { Properties.Settings.Default.Dir = value; Properties.Settings.Default.Save(); }
        }

        public static string AppDir
        {
            get { return System.Windows.Forms.Application.StartupPath.TrimEnd('\\') + "\\tpl\\"+ Tpl + "\\"; }
        }

        public static string Tpl
        {
            get {
                string tpl = "bsfAdo";
                if (System.Configuration.ConfigurationManager.AppSettings.AllKeys.Contains("Tpl"))
                {
                    tpl = System.Configuration.ConfigurationManager.AppSettings["Tpl"];
                }
                return tpl;
            }
        }

        public static string NameSpace
        {
            get { return Properties.Settings.Default.NameSpace.TrimEnd('\\'); }
            set { Properties.Settings.Default.NameSpace = value; Properties.Settings.Default.Save(); }
        }

    }
}
